/**********充值******/
function recharge() {
    var money = $("#money").val();
    $.getJSON(recharge_url, { money: money }, function(data) {
        if (data.error == 0) {
            window.location.href = data.msg;
        } else {
            dialog(data.msg);
        }
    })
}

function noti() {
    $.getJSON("/BoxApi/Index/noti", function(data) {
        var msgcount = data.msg_count;
        var list = data.list;
        if ($("#msg_noti_list_div").length > 0 && list != null) {
            box_render(list, $("#msg_noti_list_div").html(), $("#msg_noti_list"), "html");
        }

        if (msgcount != null && msgcount.comment > 0) {
            var text = "消息";
            $(".msg_remain_count").text(text + "(" + msgcount.comment + ")");
            $(".msg_remain_count").css("color", "red");
            if ($(".msg_remain_count_wap").length > 0) {
                //  $(".msg_remain_count_wap").text(msgcount.comment);
                $(".msg_remain_count_wap").show();
            }
        } else {
            $(".msg_remain_count").text(text);
            $(".msg_remain_count").css("color", "#9d9d9d");
            $(".msg_remain_count_wap").hide();
        }

    })
}

$(function() {
    noti();
    setInterval(noti, 5000);

    //var user_info = app_init_data.user_info;
    // set_shcool(user_info);
});


 
